<?php

    // uncomment the following to define a path alias
    // Yii::setPathOfAlias('local','path/to/local-folder');

    // This is the main Web application configuration. Any writable
    // CWebApplication properties can be configured here.
    return array(
        'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
        'name'=>'Dimble\'s Playground',

        // preloading 'log' component
        'preload'=>array('log'),
        'language' => 'es',

        // autoloading model and component classes
        'import'=>array(
            'application.models.*',
            'application.components.*',
            'application.modules.user.models.*',
            'application.modules.user.components.*',
            'application.modules.rights.models.*',
            'application.modules.rights.components.*',
            'ext.giix-components.*', // giix components
        ),

        'modules'=>array(
            // uncomment the following to enable the Gii tool
            'gii'=>array(
                'class'=>'system.gii.GiiModule',
                'password'=>'unholy',
                // If removed, Gii defaults to localhost only. Edit carefully to taste.
                'ipFilters'=>array('127.0.0.1','::1'),
                'generatorPaths' => array(
					'ext.giix-core', // giix generators
				),
            ),
            'user'=>array(
                # encrypting method (php hash function)
                'hash' => 'md5',
                # send activation email
                'sendActivationMail' => true,
                # allow access for non-activated users
                'loginNotActiv' => false,
                # activate user on registration (only sendActivationMail = false)
                'activeAfterRegister' => false,
                # automatically login from registration
                'autoLogin' => true,
                # registration path
                'registrationUrl' => array('/user/registration'),
                # recovery password path
                'recoveryUrl' => array('/user/recovery'),
                # login form path
                'loginUrl' => array('/user/login'),
                # page after login
                'returnUrl' => array('/user/profile'),
                # page after logout
                'returnLogoutUrl' => array('/user/login'),
            ),
            'rights'=>array(
                // Name of the role with super user privileges. 
                'superuserName'=>'Admin',
                // Name of the authenticated user role. 
                'authenticatedName'=>'Authenticated',
                // Name of the user id column in the database. 
                'userIdColumn'=>'id',
                // Name of the user name column in the database. 
                'userNameColumn'=>'username',
                // Whether to enable authorization item business rules. 
                'enableBizRule'=>true,  
                // Whether to enable data for business rules. 
                'enableBizRuleData'=>true,   
                // Whether to use item description instead of name. 
                'displayDescription'=>true,  
                // Key to use for setting success flash messages. 
                'flashSuccessKey'=>'RightsSuccess', 
                // Key to use for setting error flash messages. 
                'flashErrorKey'=>'RightsError', 
                // Base URL for Rights. Change if module is nested. 
                'baseUrl'=>'/rights', 
                // Layout to use for displaying Rights. 
                //'layout'=>'rights.views.layouts.main',  
                // Application layout. 
                //'appLayout'=>'application.views.layouts.main', 
                // Style sheet file to use for Rights. 
                //'cssFile'=>'rights.css', 
                // Whether to enable installer. 
                'install'=>false,
                'debug'=>false,         
            ),
        ),

        // application components
        'components'=>array(
            'user'=>array(
                // enable cookie-based authentication
                'allowAutoLogin'=>true,
                'class' => 'RWebUser',
                'loginUrl' => array('/user/login'),
            ),
            'authManager'=>array(
                'class'=>'RDbAuthManager',
                'connectionID'=>'db',
                'assignmentTable' => 'tbl_auth_assignment',
                'itemTable' => 'tbl_auth_item',
                'itemChildTable' => 'tbl_auth_item_child',
                'rightsTable' => 'tbl_rights',
                'defaultRoles'=>array('Unauth'),
            ),
            'urlManager'=>array(
                'urlFormat'=>'path',
                'showScriptName' => false,
                'rules'=>array(
                    '<controller:\w+>/<id:\d+>'=>'<controller>/view',
                    '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
                    '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
                ),
            ),
            'db'=>array(
                'connectionString' => 'mysql:host=localhost;dbname=d_playground',
                'tablePrefix' => 'tbl_',
                'emulatePrepare' => true,
                'username' => 'root',
                'password' => 'unholy',
                'charset' => 'utf8',
            ),
            'errorHandler'=>array(
                // use 'site/error' action to display errors
                'errorAction'=>'site/error',
            ),
            'log'=>array(
                'class'=>'CLogRouter',
                'routes'=>array(
                    array(
                        'class'=>'CFileLogRoute',
                        'levels'=>'error, warning',
                    ),
                    // uncomment the following to show log messages on web pages
                    /*
                    array(
                    'class'=>'CWebLogRoute',
                    ),
                    */
                ),
            ),
        ),

        // application-level parameters that can be accessed
        // using Yii::app()->params['paramName']
        'params'=>array(
            // this is used in contact page
            'adminEmail'=>'dimble.playground@gmail.com',
        ),
    );